package com.sky.config;

import com.sky.properties.AliOssProperties;
import com.sky.utils.AliOssUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @version 1.0
 * @Title: OSSConfiguration
 * @Author 张宇
 * @Package com.sky.config
 * @Date 2025/9/29 15:11
 */

/**
 * 阿里配置类,交由IOC容器管理
 */
@Slf4j
@Configuration
public class OSSConfiguration {


    @Bean
    public AliOssUtil aliOssUtil(AliOssProperties aliOssProperties) {
        log.info("开始初始化aliOssUtil");
        return new AliOssUtil(aliOssProperties.getEndpoint(), aliOssProperties.getAccessKeyId(), aliOssProperties.getAccessKeySecret(), aliOssProperties.getBucketName());
    }


}
